package polymorphicTask.perimeterAndArea;

import InheritTask.AnimalWorld.Rabbit;

public class Rectangle extends Diagram{
    private int length;
    private int height;

    public Rectangle(){}

    public Rectangle(int length, int height) {
        this.length = length;
        this.height = height;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
    public void perimeter(){
        System.out.println("长方形的周长为："+(length+height)*2);
    }
    public void area(){
        System.out.println("长方形的面积为："+length*height);
    }
}
